Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

187887752 date format improvements, attribute refinements #23

Merged
merged 12 commits into from
Aug 15, 2024

Conversation

bacalj
Copy link
Collaborator

@bacalj bacalj commented Aug 12, 2024

This makes some adjustments to address date formatting issues evident in work originating in PT-187887752. It also contains fixes that address PT-187887752 and PT-188074070 and PT-188092756 and PT-188045605

  1. The project team would like dates visible as YYYY/MM/DD
  2. The project team would like clock times expressed as "decimal hours", e.g. 1:15PM = 13.25

Changes:

  • formulas are added for sunrise and sunset, and internal sunrise and sunset dates are hidden, but used in formula
  • constants added for time format for clarity of purpose and iteration/testing in dev
  • update of attribute visibility is now synchronous (async was resulting in unresolved promise pile up - did not try Promise.all, because timing is working fine for this feature) - this change was made because attributes were re-calculating/rendering during interaction with tokens
  • we now assert cases exist when testing for a delete event (unrelated to above)
  • we get times into utc earlier in calculation so we don't get one-off offsets on DLS changeover days in places that don't use DST
  • we add an optional transformation to "spring forward" outliers (we can set the flag according to project team decision)
  • commenting out of stubbed items to reduce warning noise
  • we set a floor of 0 for solar intensity (which may need to be reflected in sim)
  • we make rows that occur in polar night or midnight sun changeovers display a logical day length

- setting up constants for iteration/testing
- improve day calculations to avoid cross-midnight issues
… allow for meaningful graphs of sunrise and sunset times
- make all attributes show and disable hide/show for now (bug to fix)
- make attributes for clock times categorical
- set format to hh:mm a
@bacalj bacalj requested a review from kswenson August 12, 2024 15:30
@bacalj bacalj marked this pull request as draft August 12, 2024 18:02
- if we spring forward, we lose an hour
- it will come out of day length if transition happens after sunrise, in UTC
- so on transition days like this we can adjust to remove outlier
- but this is commented out for now
asClockTimeStringAMPM: "h:mm a", // 2:45 PM
}

export const kDateFormats = {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we end up using formulas for the date display column we will not need these, these are mostly here for making iteration easier.

src/constants.ts Outdated Show resolved Hide resolved
@bacalj bacalj changed the title 187887752 date format improvements 187887752 date format improvements and function use proof-of-concept Aug 13, 2024
@bacalj bacalj marked this pull request as ready for review August 13, 2024 14:09
@bacalj bacalj marked this pull request as draft August 13, 2024 18:05
@bacalj bacalj marked this pull request as ready for review August 14, 2024 18:00
@bacalj bacalj changed the title 187887752 date format improvements and function use proof-of-concept 187887752 date format improvements, attribute refinements Aug 14, 2024
Copy link
Member

@kswenson kswenson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM -- just a couple of minor comments/suggestions.

src/components/App.tsx Show resolved Hide resolved
src/constants.ts Show resolved Hide resolved
src/utils/daylight-utils.ts Show resolved Hide resolved
@bacalj bacalj merged commit b6b94ad into main Aug 15, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants